'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add altering commands here.
     *
     * Example:
     * await queryInterface.createTable('users', { id: Sequelize.INTEGER });
     */
    const { STRING, INTEGER, DATE, UUIDV4, UUID, BOOLEAN } = Sequelize;
    await queryInterface.createTable('admins', {
      id: { type: INTEGER, primaryKey: true, autoIncreament: true },
      name: STRING(30),
      age: INTEGER,
      is_able: BOOLEAN,
      province_code: STRING(10),
      city_code: STRING(10),
      county_code: STRING(10),
      address: STRING(10),
      id_number: STRING(24),
      created_at: DATE,
      updated_at: DATE,
      uuid: { type: UUID, defaultValue: UUIDV4 },
    });
  },

  down: async queryInterface => {
    /**
     * Add reverting commands here.
     *
     * Example:
     * await queryInterface.dropTable('users');
     */
    await queryInterface.dropTable('admins');
  },
};
